package basic;

public class Whileloop2 {
    public static void main(String[] args) {
        int sum = 0;//累加和
        int i = 1;
        while (i <= 5){
            sum = sum + i; //使sum和i相加，并将值再次赋值给sum
            i ++; //i自增1
        }
        System.out.println("1到100的累加和为：" + sum);
    }
}
